package com.yhc.my.an_meishia.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

/**
 * Created by My on 2016/8/28.
 */
public class MovieDao {

    private final SQLiteDatabase mDb;

    public MovieDao(Context context) {
        DBHelper helper = new DBHelper(context);
        mDb = helper.getWritableDatabase();
    }
  //获取数据库对象
    public SQLiteDatabase getDb() {
        if (mDb != null) {
            return mDb;
        }
        return null;
    }
    public void execSql(String sql,String[] args){
        if (args!=null){
            mDb.execSQL(sql,args);
        }else {
            mDb.execSQL(sql);
        }
    }
}
